<%@ page language="java" pageEncoding="utf-8" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<html>
<head>
    <title>用户登录</title>
    <style type="text/css">
        .form {
            margin: 0 auto;
            margin-top: 300px;
            width: 300px;
            height: 600px;
        }

        .btn {
            border: 0;
            background-color: #428bca;
        }


    </style>


    <script
            src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
        function getSomeThing() {
            $.ajax({
                type: "POST",
                url: "welcome/getWelcome",
                contentType: "application/json",
                data: null,
                success: function () {
//                    alert("22");
                },
                error: function () {
//                    alert("失败！");
                }
            });
        }

        function getLogin() {
            $.ajax({
                type: "POST",
                url: "welcome/backLogin",
                contentType: "application/json",
                data: null,
                success: function () {
//                    alert("22");
                },
                error: function () {
//                    alert("失败！");
                }
            });
        }
    </script>
</head>
<body background="${pageContext.request.contextPath }/static/image/bgroudimg.png"
      style="background-attachment: scroll;margin: auto;">

<div>
    <button type="button" onclick="getSomeThing()">Click Me!</button>
    <button type="button" onclick="getLogin()">Click Me2!</button>
</div>

<form class="form" action="${pageContext.request.contextPath }/user/login" method="post">
    <span style="color: red;">${message }</span><br/>
    登录名：<input type="text" name="username"/><br>
    密码：<input type="password" name="password"/><br>
    <input class="btn" type="submit" value="登录"/><input type="reset" value="清空"/>

</form>

</body>
</html>
